1. Field of the Invention
The present invention relates to a method of reading bar codes and an apparatus therefor, and more particularly to a bar code reading method and apparatus which are unaffected by the speed at which the bar code is scanned.
2. Background Description
Many different types of bar codes are known. FIGS. 12 to 15 show several typical bar codes. Specifically, FIG. 12 shows a bar code which is composed of thin and thick printed bars and thin and thick spaces. Thick bars and spaces represent binary "1" whereas thin bars and spaces represent binary "0".
FIG. 13 depicts a bar code which is composed of thin and thick printed bars but only thin spaces. Thick bars represent binary "1", and thin bars represent binary "0"; spaces, however, have no significance as data.
FIG. 14 shows a bar code which is composed of thin and thick spaces and thin printed bars. Thick spaces represent binary "1", and thin spaces represent binary "0", while the bars have no significance as data.
Finally, FIG. 15 shows a bar code of the J.A.N., UPC and WPC types. In this bar code a numerical character is composed of seven elements or bits of equal width. A given element may be a bar (dark) or a space. The various possible combinations of the seven elements is such that they form two bars and two spaces. The element which occupies a bar area represents binary "1" whereas each space area represents binary "0". Thus, for example, a very thick bar can be used to represent a series of three "1"s which follow one another, without separation spaces therebetween.
The portions of the bar code marked CS in FIGS. 12 and 13 represent an inter-character space and not data per se. No inter-character spaces, however, appear in FIGS. 14 and 15.
Different methods have been employed for reading bar codes. A first reading method comprises the steps of scanning the code pattern with an optical reader and generating a numerical count while each bar and space is being scanned to provide a measure of the bar's or space's width. The obtained counts are compared to a fixed reference value to determine the binary digit which it represents.
A second reading method appropriate for reading a bar code as shown in FIG. 12 comprises the steps of: scanning the bar code to obtain bar and space width counts sequentially, comparing the count of the bar read first by the optical reader with the count of the space adjacent to the first bar to determine the binary digit represented by the first bar. Or, similarly, the count of the space width which is read first is compared to the count of the adjacent bar to determine the binary digit represented by the space, and so on.
The first reading method uses a fixed reference value. However, the count of a bar or a space varies with the speed at which the optical reader scans the bars and spaces. Therefore, the speed at which the optical reader scans the bar codes must be maintained within given limits. If not, reading errors will occur. Such reading errors are common with manual sweeping.
The second reading method is disadvantageous in that it cannot be used to read a bar code as shown in FIG. 15. In the bar code of FIG. 15, the counts of bars and spaces are sequentially compared with each other to determine the binary digits they represent. Therefore, if the printing should be somewhat blurred, an incorrect count will be generated.
In an attempt to solve these problems, a reading method which is deemed to be most appropriate for reading the bar codes of the type shown in FIG. 12 has been proposed in Japanese Laid-Open Patent Application No. 57-34540 (Patent Application No. 47-113058). According to the proposed method, bars are compared to each other. Likewise, spaces are compared to each other. Thus, counts of two subsequent bar widths are compared to each other to determine which one is larger, the wider bar (larger count) being deemed to represent binary "1" whereas the narrower bar (lower count) is deemed to represent binary "0". Likewise, two subsequent spaces are compared to each other to determine which one is larger in value. The larger one (or wider space) is deemed to represent binary "1" whereas the smaller one (or thinner space) is deemed to represent binary "0".
The proposed method, however, requires subsequent bars (or spaces) to have different widths. In order to meet this requirement, a variety of bar and space widths must be used. This, however, places limits on optimizing bar density and simplicity. In an attempt to solve this problem, the inventor of Application No. 57-34540 referred to above has proposed in another invention (Japanese Patent Application Laid Open No. 55-49354; Patent Application No. 48-34732) an alternate approach. The newest proposal may be applied to a bar code composed of bars (or spaces) of equal width to determine binary digits represented by bars (or spaces) with greater accuracy.
Specifically, according to this method, the bar (or space) at the first location of the bar code will be referred to as the standard bar and its width will be referred to as a first value. The next bar (or space) will be referred to as the object bar (or space) and a second value will be defined which equals the width of the object bar (or space) multiplied by a constant K which is greater than 1. A third value is generated which is calculated by taking actual value of the object bar and dividing it by the constant K. Then a determination as to whether the object bar (or space) represents a "0" or a "1" is made as follows:
(1) if the first value is larger than the second value, the object bar (or space) is thin, representing binary "0";
(2) if the first value is smaller than the third value, the object bar (or space) is wide, representing binary "1"; and
(3) if the first value is smaller than the second value but larger than the third value, the object bar appears to be equal in width to the standard bar (or space), and the determination whether the object bar (or space) represents a "0" or a "1" is deferred until a comparison of the counts of the next bar and space widths is completed.
This last reading method, which is a combination of the previous two reading methods is free of the disadvantage of having to control the sweeping speed of the optical reader.
It does, however, have the following fault:
Let it be assumed that the width ratio of the thin bar (or space) to a thick bar (or space) is equivalent to 1:2, and that the value for the constant "K" is 1.5. Let it further be assumed that the thick bar is somewhat blurred or defective so that the actual width ratio is equal to about 1:1.4. In this case, the first value N=1; the second value equals 1.4NK=2.10N; and the third value=1.4N/K=0.93N, where "N" stands for the value of the width at the ratio of one. In the example given above the second bar (or space), namely the object bar, is wider than the standard bar (or space). According to the method described above one should obtain the result: second value&gt;third value&gt;first value. Instead in this case an erroneous result is obtained that: second value&gt;first value&gt;third value. The same error appears in respect of spaces. Also disadvantageously, the third reading method can not be applied to a bar code as shown in FIG. 15, as is the case with the second reading method.
A reading method which is exclusively applied to a bar code of FIG. 15 comprises the steps of: obtaining a value corresponding to the width of a single element or bit by scanning a start bar (not shown) with an optical reader, and making a decision as to where each subsequent bit is located on a bar or on a space. This determines whether the bit is a binary "1" or "0".
This reading method, however, again requires constant speed scanning, producing erroneous readings with manually movable optical readers.
Therefore, all the known reading methods are unsatisfactory in one respect or another.